<template>
  <view>
    <navigator
        :openType="pages.length == 1 ? 'switchTab' : 'navigateBack'"
        :style="'top:' + nTop + 'px'"
        :url="pages.length == 1 ? '/pages/index/index4' : ''"
        class="UgobackFix"
        hoverClass="none"
    >
      <view class="i ico">{{ pages.length == 1 ? '' : '' }}</view>
    </navigator>
    <swiper :autoplay="true" :circular="true" :indicatorDots="true" class="banner" duration="1000"
            indicatorActiveColor="#fff" indicatorColor="#fff" interval="3000">
      <swiper-item v-for="(item, banner_idx) in banner" :key="banner_idx">
        <image :id="'img' + banner_idx" :data-cur="item" :src="item" mode="aspectFill" @tap="bannerFn"></image>
      </swiper-item>
    </swiper>
    <view class="titleinfo">
      <view class="h1">{{ D.title }}</view>
      <view class="bmrs2">
        <view class="dl">
          <view class="dt">
            <text v-if="D.num_n == 0" class="b">不限</text>
            <block v-else>
              <text class="b">{{ D.num_n }}</text>
              人
            </block>
          </view>
          <view class="dd">邀请男生</view>
        </view>
        <view class="dl">
          <view class="dt">
            <text v-if="D.num_r == 0" class="b">不限</text>
            <block v-else>
              <text class="b">{{ D.num_r }}</text>
              人
            </block>
          </view>
          <view class="dd">邀请女生</view>
        </view>
        <view class="dl">
          <view class="dt">
            <text v-if="D.rmb_n == 0" class="b C090">免费</text>
            <block v-else>
              <text class="b">{{ D.rmb_n }}</text>
              元
            </block>
          </view>
          <view class="dd">男生费用</view>
        </view>
        <view class="dl">
          <view class="dt">
            <text v-if="D.rmb_r == 0" class="b C090">免费</text>
            <block v-else>
              <text class="b">{{ D.rmb_r }}</text>
              元
            </block>
          </view>
          <view class="dd">女生费用</view>
        </view>
      </view>
    </view>
    <view class="h5h5">
      <view v-if="DJS.flag == 1" :style="'--rgbcolor:' + rgbcolor" class="djs">
        <text class="i ico"> {{ DJS.title }}</text>
        <block v-if="djs_D > 0">
          <text class="font">{{ djs_D }}</text>
          <text class="span">天</text>
        </block>
        <block v-if="djs_H > 0">
          <text class="font">{{ djs_H }}</text>
          <text class="span">时</text>
        </block>
        <block v-if="djs_M > 0">
          <text class="font">{{ djs_M }}</text>
          <text class="span">分</text>
        </block>
        <text class="font">{{ djs_S }}</text>
        <text class="span">秒</text>
      </view>
      <view v-if="BM.num > 0" class="ul">
        <image v-for="(item, index) in BM.ulist" :key="index" :src="item" mode="aspectFill"></image>
        <view class="li more">
          <text class="i ico"></text>
        </view>
      </view>
      <view class="h5">时间：{{ D.hdtime }}</view>
      <view class="h5">
        地点：{{ D.address }}
        <view class="sapn icomap">
          <text class="i ico"></text>
          <text class="font" @tap="mapFn">地图</text>
        </view>
      </view>
    </view>
    <view :style="'--color:' + color + ';--rgbcolor:' + rgbcolor" class="topbar">
      <text v-for="(item, index) in topbar" :key="index" :class="'item ' + (currentTab == index ? 'active' : '')"
            :data-idx="index" @tap="topbarFn">
        {{ item }}

        <text v-if="signnum > 0 && index == 1" class="b">{{ signnum }}</text>

        <text v-if="bbsnum > 0 && index == 2" class="b">{{ bbsnum }}</text>
      </text>
    </view>
    <view v-if="currentTab == 0" class="detail_C">
      <rich-text :nodes="content" class="CC"></rich-text>
      <view class="party_kefu">
        <view class="linebox">
          <view class="line"></view>
          <view class="title S14 BAI">活动咨询</view>
        </view>
        <view class="em">
          <view>遇到问题？请联系客服帮忙。</view>
          <view @tap="telFn">
            <text class="ico"></text>
            {{ D.kf_tel }}
          </view>
          <view @tap="mobFn">
            <text class="ico"></text>
            {{ D.kf_mob }}
          </view>
        </view>
        <image :showMenuByLongpress="true" :src="D.kf_wxpic" mode="aspectFill"></image>
        <view class="font">长按或扫码加客服微信</view>
      </view>
    </view>
    <view v-if="currentTab == 1" class="sign">
      <view v-if="signnum > 0" class="signlist">
        <view v-for="(item, index) in signulist" :key="index">
          <image :src="item.p" mode="aspectFill"></image>

          <text>{{ item.n }}</text>
        </view>
      </view>
      <view v-else class="nodata">
        <image mode="aspectFit" src="/static/res/img/nodata.png"></image>
        暂时还没有人签到
      </view>
      <view class="signtips ico"> 参加活动时，请携带本人身份证到现场签到</view>
    </view>
    <view v-if="currentTab == 2" class="bbs">
      <block v-if="bbsnum > 0">
        <view v-for="(item, index) in bbslist" :key="index" class="dl">
          <view class="dt">
            <image :src="item.p" mode="aspectFill"></image>
          </view>

          <view class="dd">
            <view class="h6">
              <text class="font">{{ item.n }}</text>
              <image :src="item.i" class="ugrade1" mode="aspectFill"></image>
            </view>
            <view class="em">{{ item.c }}</view>
            <view class="span">{{ item.a }}</view>
          </view>
        </view>
      </block>
      <view v-else class="nodata">
        <image mode="aspectFit" src="/static/res/img/nodata.png"></image>
        暂无信息
      </view>
    </view>
    <view :style="'--color:' + color + ';--rgbcolor:' + rgbcolor" class="Btmbtn">
      <view class="a bbsbtn" @tap="bbs_btnFn">
        <text class="i ico"></text>
        <text class="span">评论</text>
      </view>
      <view class="a kefu" @tap="zxFn">
        <text class="i ico"></text>
        <text class="span">咨询</text>
      </view>
      <button class="a share" openType="share">
        <text class="i ico"></text>
        <text class="span">分享</text>
      </button>
      <view :class="'a ' + D.bmbtn_cls" @tap="bm_addFn">{{ D.bmbtn_str }}</view>
    </view>
    <view v-if="div_bbs" class="mask2 alpha0_100">
      <view class="div_box big_normal div_bbs" style="width: 82%; height: 480rpx">
        <view class="close ico" @tap="div_bbs_closeFn"></view>
        <view class="div_title">我来说两句</view>
        <form @submit="div_bbs_submitFn">
          <textarea class="textarea" name="content" placeholder="请文明发言输入对此活动的简短评论"></textarea>
          <button :style="'--color:' + color + ';--rgbcolor:' + rgbcolor + ';'" class="btn4 ico" formType="submit">
            提交评论
          </button>
        </form>
      </view>
    </view>
    <view v-if="div_bm_add" class="mask2 alpha0_100">
      <view class="div_box big_normal div_bm_add" style="width: 82%; height: 780rpx">
        <view class="close ico" @tap="div_bbs_closeFn"></view>
        <view class="div_title">填写报名资料</view>
        <form class="form" @submit="div_bm_add_submitFn">
          <view class="dl">
            <view class="dt">性别</view>
            <view class="dd">
              <radio-group name="sex">
                <label class="sex1">
                  <radio :checked="U.cook_sex == 1 ? 'true' : ''" color="#5FC5F5" value="1"></radio>
                  男
                </label>
                　　
                <label class="sex2">
                  <radio :checked="U.cook_sex == 2 ? 'true' : ''" color="#FF589B" value="2"></radio>
                  女
                </label>
              </radio-group>
            </view>
          </view>
          <view :style="'--color:' + color + ';--rgbcolor:' + rgbcolor" class="dl">
            <view class="dt">手机</view>
            <view class="dd">
              <input v-if="!globalUtils.empty(U.cook_mob)" :disabled="true" :value="U.cook_mob" class="input"
                     maxlength="11"
                     name="mob" placeholderClass="placeholder"/>
              <block v-else>
                <input
                    :disabled="true"
                    :value="U.cook_mob"
                    class="input"
                    maxlength="11"
                    name="mob"
                    placeholder="输入手机1"
                    placeholderClass="placeholder"
                    style="display: none"
                    @tap="getmobFn"
                />
                <button class="input placeholder getmobFn" openType="getPhoneNumber" @getphonenumber="getmobFn">
                  输入手机
                </button>
              </block>
            </view>
          </view>
          <view class="dl">
            <view class="dt">微信</view>
            <view class="dd">
              <input :value="U.cook_weixin" autocomplete="off" class="input" maxlength="50" name="weixin"
                     placeholder="输入微信" placeholderClass="placeholder"/>
            </view>
          </view>
          <view class="dl">
            <view class="dt">姓名</view>
            <view class="dd">
              <input :value="U.cook_truename" autocomplete="off" class="input" maxlength="30" name="truename"
                     placeholder="输入姓名" placeholderClass="placeholder"/>
            </view>
          </view>
          <view class="dl">
            <view class="dt">生年</view>
            <view class="dd">
              <input
                  :value="U.cook_birthday"
                  autocomplete="off"
                  class="input"
                  maxlength="4"
                  name="birthday"
                  placeholder="输入出生年份，如：1995"
                  placeholderClass="placeholder"
                  type="number"
              />
            </view>
          </view>
          <view class="em">以上信息仅用于活动报名联系通知，不对外公开</view>
          <button :style="'--color:' + color + ';--rgbcolor:' + rgbcolor + ';'" class="btn44 ico" formType="submit">
            提交报名
          </button>
        </form>
      </view>
    </view>
    <!-- parse <include src="../login.wxml"></include> -->
    <block>
      <view v-if="div_login" class="mask3 alpha0_100">
        <view
            class="div_box big_normal"
            style="width: 82%; height: 666rpx; background: -webkit-linear-gradient(top, #fde9ee 1%, #fff 150%); background-color: #fff"
        >
          <view :style="'border-color:rgba(' + rgbcolor + ',.2);'" class="m">
            <image mode="aspectFit" src="/static/res/img/photo_m.png"></image>
          </view>
          <view class="S22 B">登录后获得更精准推荐</view>
          <view class="loginagree">
            <checkbox-group @change="ifagreeFn">
              <label style="margin-left: -10rpx">
                <checkbox :style="'--color:' + color + ';'" value="1"></checkbox>
                <text class="C666 vmiddle">阅读并同意</text>
              </label>
            </checkbox-group>
            <navigator :style="'color:' + color" class="vmiddle" hoverClass="none"
                       url="/pagesA/about/law?kind=agreement">用户协议
            </navigator>
            <text class="C666 vmiddle">与</text>
            <navigator :style="'color:' + color + ';'" class="vmiddle" hoverClass="none"
                       url="/pagesA/about/law?kind=declara">隐私条款
            </navigator>
          </view>
          <button
              v-if="ifagree"
              :style="'--color:' + color + ';--rgbcolor:' + rgbcolor + ';width:73%'"
              class="btn5 W90_"
              openType="getPhoneNumber"
              @getphonenumber="getPhoneNumber"
          >
            <text>手机号快捷登录</text>
            <text :style="'color: ' + color + ';'">私密</text>
          </button>
          <button v-else :style="'--color:' + color + ';--rgbcolor:' + rgbcolor + ';width:73%'"
                  class="btn5" @tap="ifagree_passFn">
            <text>手机号快捷登录</text>
            <text :style="'color: ' + color + ';'">私密</text>
          </button>
          <view class="C666" @tap="back">
            <text style="border-bottom: #999 1px solid">暂不登录</text>
          </view>
        </view>
      </view>
    </block>
    <!-- parse <include src="../component/sorry.wxml"></include> -->
    <block>
      <view v-if="div_vip" :class="'mask2 ' + mask_class" data-maskid="div_vip" @tap="mask_closeFn">
        <view :style="'width:600rpx;height:' + (div_vip_H > 0 ? div_vip_H : 480) + 'rpx;'"
              class="div_box div_vip"
              @tap.stop.prevent="emptyFn">
          <view class="closebtm ico" data-maskid="div_vip" @tap.stop.prevent="mask_closeFn"></view>
          <view class="h1">{{ div_vip_title }}</view>
          <text v-if="!globalUtils.empty(div_vip_content)" class="C S15">{{ div_vip_content }}</text>
          <block v-else>
            <view class="C S15">开通VIP超级会员，专享超值权益</view>
            <view class="C S15">相亲成功率大大提升</view>
          </block>
          <view class="ico picico"></view>
          <view class="btn_btm btn44 ico" @tap.stop.prevent="vipFn"> 立即开通</view>
        </view>
      </view>
      <view v-if="div_cert" :class="'mask2 ' + mask_class" data-closekind="back" data-maskid="div_cert"
            @tap="mask_closeFn">
        <view class="div_box div_cert" style="width: 600rpx; height: 480rpx"
              @tap.stop.prevent="emptyFn">
          <view class="closebtm ico" data-closekind="back" data-maskid="div_cert" @tap.stop.prevent="mask_closeFn">
          </view>
          <view class="h1">{{ div_cert_title }}</view>
          <view class="C S15">成为认证用户，即享沟通特权</view>
          <view class="C S15">提高诚信值，杜绝虚假</view>
          <view class="ico picico"></view>
          <view class="btn_btm btn44 ico" @tap.stop.prevent="certFn">立即认证</view>
        </view>
      </view>
      <view v-if="div_data" :class="'mask2 ' + mask_class" data-closekind="back" data-maskid="div_data"
            @tap="mask_closeFn">
        <view :style="'width:600rpx;height:490rpx;--color:' + color + ';--rgbcolor:' + rgbcolor"
              class="div_box div_data"
              @tap.stop.prevent="emptyFn">
          <view class="closebtm ico" data-closekind="back" data-maskid="div_data" @tap.stop.prevent="mask_closeFn">
          </view>
          <view class="h1">{{ div_data_title }}</view>
          <view class="C S15">赶快去完善，解锁更多功能</view>
          <view class="C S15">完成资料，上传头像，受关注度暴增</view>
          <view class="C S15 Cf00">如果还未审核，请等待审核</view>
          <view class="ico picico"></view>
          <view class="btn_btm btn44 ico" @tap.stop.prevent="dataFn">立即完善</view>
        </view>
      </view>
      <view v-if="div_gps" :class="'mask2 ' + mask_class" data-closekind="back" data-maskid="div_gps"
            @tap="mask_closeFn">
        <view :style="'width:550rpx;height:480rpx;--color:' + color + ';--rgbcolor:' + rgbcolor"
              class="div_box div_gps"
              @tap.stop.prevent="emptyFn">
          <view class="closebtm ico" data-closekind="back" data-maskid="div_gps" @tap.stop.prevent="mask_closeFn">
          </view>
          <view class="h1">{{ div_gps_title }}</view>
          <view class="C S15">授权后，将自动获取您当前位置</view>
          <view class="C S15">否则将无法使用《附近的人》功能</view>
          <view class="ico picico"></view>
          <view class="btn_btm btn44 ico" @tap.stop.prevent="gpsFn">同意获取位置</view>
        </view>
      </view>
    </block>
    <view v-if="backtop_flag" :style="'color:' + color" class="backtop fadeInUp" data-id="index" @tap="backtopFn">
      <text class="ico icon-backtop"></text>
      顶部
    </view>
    <view class="blank"></view>
  </view>
</template>
<script>
import globalUtils from "../../res/www.a9a.cn";

var t;
var a = require('../../@babel/runtime/helpers/defineProperty');
var n = require('../../res/www.a9a.cn.js');
var app = getApp();
export default {
  computed: {
    globalUtils() {
      return globalUtils
    }
  },
  data() {
    return {
      topbar: ['活动介绍', '现场签到', '活动交流'],
      currentTab: 0,
      setInter: '',
      mask_class: 'alpha0_100',
      div_hn_btm_box_class: 'div_upAnm1',
      fid: '',
      color: '',
      rgbcolor: '',
      backtop_flag: false,

      D: {
        title: '',
        num_n: 0,
        num_r: 0,
        rmb_n: 0,
        rmb_r: 0,
        hdtime: '',
        kf_wxpic: '',
        bmbtn_cls: '',
        bmbtn_str: ''
      },

      BM: {
        num: 0,
        ulist: []
      },

      DJS: {
        flag: 0,
        title: ''
      },

      banner: '',
      signnum: '',
      bbsnum: '',
      content: '',
      ios_ifpay: '',
      div_bm_add: false,

      U: {
        cook_sex: 0,
        cook_mob: '',
        cook_weixin: '',
        cook_truename: '',
        cook_birthday: ''
      },
      djs_D: '',
      djs_H: '',
      djs_M: '',
      djs_S: '',
      signulist: '',
      bbslist: '',
      div_bbs: false,
      div_login: false,
      ifagree: false,
      pages: [],
      nTop: '',
      banner_idx: 0,
      div_vip: '',
      div_vip_H: 0,
      div_vip_title: '',
      div_vip_content: '',
      div_cert: '',
      div_cert_title: '',
      div_data: '',
      div_data_title: '',
      div_gps: false,
      div_gps_title: ''
    };
  },
  onLoad: function (t) {
    var that = this;
    if (n.ifint(t.fid)) {
      var o = t.fid;
    } else {
      var e = decodeURIComponent(t.scene);
      o = (e = e.split('='))[1];
    }
    this.setData({
      fid: o
    });
    app.globalData.get_config('_ZEAI').then(function (t) {
      that.setData({
        color: app.globalData._ZEAI.color,
        rgbcolor: n.c16_rgb(app.globalData._ZEAI.color)
      });
    });
    app.globalData.get_navigationBarTopHeight(this);
    app.globalData.get_openid().then(function (t) {
      that.init();
    });
  },
  onPageScroll: function (t) {
    t.scrollTop > 100
        ? this.setData({
          backtop_flag: true
        })
        : this.setData({
          backtop_flag: false
        });
  },
  onShareAppMessage: function () {
    return {
      imageUrl: this.D.path_b,
      title: this.D.wxshareC,
      path: '/pagesA/party/party_detail?fid=' + this.fid
    };
  },
  onShareTimeline: function () {
    var t;
    t = {
      imageUrl: this.D.path_b,
      title: this.D.wxshareC,
      query: ''
    };
    a(t, 'query', 'fid=' + this.fid);
    a(t, 'path', '/pagesA/party/party_detail');
    return t;
  },
  methods: {
    bannerFn: function (t) {
      if (!n.empty(this.banner)) {
        var a = t.currentTarget.dataset.cur;
        n.empty(a) ||
        uni.previewImage({
          current: a,
          urls: this.banner
        });
      }
    },

    init: function () {
      var that = this;
      n.ifint(this.fid) ||
      uni.showModal({
        content: '参数跑路了',
        confirmColor: that.color,
        confirmText: '朕知道了',
        showCancel: false,
        success: function (t) {
          uni.navigateBack();
        }
      });
      uni.showLoading({
        title: '玩命加载中...',
        mask: true
      });
      t = uni.getStorageSync('COOK_U');
      app.globalData.ajax({
        url: 'party.php',
        data: {
          submitok: 'party_detail',
          openid: t.openid,
          fid: that.fid
        },
        success: function (t) {
          if (1 == t.flag) {
            var i = t.D.plist;
            var o = n.escape2Html(t.D.content);
            that.setData({
              D: t.D,
              BM: t.BM,
              DJS: t.DJS,
              banner: i,
              signnum: t.D.signnum,
              bbsnum: t.D.bbsnum,
              content: o,
              ios_ifpay: t.ios_ifpay
            });
            if (1 == t.DJS.flag) {
              that.DJSFn(t.DJS.difftime);
            }
          } else {
            uni.showToast({
              title: t.msg,
              icon: 'none',
              mask: true
            });
          }
          uni.hideLoading();
        }
      });
    },

    bm_addFn: function () {
      var that = this;
      app.globalData.ajax({
        url: 'party.php',
        data: {
          submitok: 'bm_add',
          openid: t.openid,
          fid: that.fid
        },
        success: function (o) {
          if (1 == o.flag) {
            that.setData({
              div_bm_add: true,
              U: o.U
            });
          } else {
            if ('pay' == o.flag) {
              if (1 == o.ifpay) {
                uni.showModal({
                  title: '',
                  content: o.msg,
                  confirmColor: that.color,
                  cancelText: '取消',
                  confirmText: '立即支付',
                  success: function (o) {
                    if (o.confirm) {
                      if (1 != that.ios_ifpay.flag) {
                        uni.getSystemInfo({
                          success: function (o) {
                            if ('ios' == o.platform) {
                              uni.showModal({
                                title: '温馨提示',
                                content: that.ios_ifpay.tips,
                                confirmColor: that.color,
                                cancelText: '返回',
                                confirmText: '联系经纪人',
                                success: function (t) {
                                  if (t.confirm) {
                                    uni.redirectTo({
                                      url: '/myPages/hongniang/hongniang'
                                    });
                                  } else {
                                    if (t.cancel) {
                                      uni.navigateBack();
                                    }
                                  }
                                }
                              });
                            } else {
                              app.globalData.pay({
                                data: {
                                  submitok: 'party_bm',
                                  openid: t.openid,
                                  fid: that.fid
                                },
                                success: function () {
                                  that.init();
                                },
                                fail: function (t) {
                                  t.this = that;
                                  t.url = 'no';
                                  n.sorry(t);
                                }
                              });
                            }
                          }
                        });
                      } else {
                        app.globalData.pay({
                          data: {
                            submitok: 'party_bm',
                            openid: t.openid,
                            fid: that.fid
                          },
                          success: function () {
                            that.init();
                          },
                          fail: function (t) {
                            t.this = that;
                            t.url = 'no';
                            n.sorry(t);
                          }
                        });
                      }
                    }
                  }
                });
              }
            } else {
              (o.this = that), (o.url = 'no'), n.sorry(o);
            }
          }
        }
      });
    },

    div_bm_add_submitFn: function (a) {
      var that = this;
      var e = a.detail.value;
      app.globalData.empty(e.sex)
          ? uni.showToast({
            title: '请选择【性别】',
            icon: 'none',
            mask: true
          })
          : app.globalData.ifmob(e.mob)
              ? app.globalData.ifweixin(e.weixin)
                  ? app.globalData.empty(e.truename)
                      ? uni.showToast({
                        title: '请输入【姓名】',
                        icon: 'none',
                        mask: true
                      })
                      : !app.globalData.empty(e.birthday) && n.ifint(e.birthday)
                          ? uni.showModal({
                            title: '',
                            content: '确定信息无误提交报名么？',
                            confirmColor: that.color,
                            cancelText: '取消',
                            confirmText: '确定',
                            success: function (a) {
                              if (a.confirm) {
                                uni.showLoading({
                                  title: '正在提交',
                                  mask: true
                                });
                                app.globalData.ajax({
                                  url: 'party.php',
                                  data: {
                                    submitok: 'bm_add_update',
                                    openid: t.openid,
                                    fid: that.fid,
                                    sex: e.sex,
                                    weixin: e.weixin,
                                    mob: e.mob,
                                    truename: e.truename,
                                    birthday: e.birthday
                                  },
                                  success: function (a) {
                                    uni.hideLoading();
                                    1 == a.flag
                                        ? uni.showModal({
                                          content: a.msg,
                                          confirmColor: that.color,
                                          confirmText: '朕知道了',
                                          showCancel: false,
                                          success: function (e) {
                                            that.setData({
                                              div_bm_add: false
                                            });
                                            1 == a.ifpay
                                                ? uni.showModal({
                                                  title: '',
                                                  content: a.ifpay_str,
                                                  confirmColor: that.color,
                                                  cancelText: '稍后支付',
                                                  confirmText: '立即支付',
                                                  success: function (a) {
                                                    a.confirm
                                                        ? 1 != that.ios_ifpay.flag
                                                            ? uni.getSystemInfo({
                                                              success: function (a) {
                                                                'ios' == a.platform
                                                                    ? uni.showModal({
                                                                      title: '温馨提示',
                                                                      content: that.ios_ifpay.tips,
                                                                      confirmColor: that.color,
                                                                      cancelText: '返回',
                                                                      confirmText: '联系经纪人',
                                                                      success: function (t) {
                                                                        t.confirm
                                                                            ? uni.redirectTo({
                                                                              url: '/myPages/hongniang/hongniang'
                                                                            })
                                                                            : t.cancel && uni.navigateBack();
                                                                      }
                                                                    })
                                                                    : app.globalData.pay({
                                                                      data: {
                                                                        submitok: 'party_bm',
                                                                        openid: t.openid,
                                                                        fid: that.fid
                                                                      },
                                                                      success: function () {
                                                                        that.init();
                                                                      },
                                                                      fail: function (t) {
                                                                        t.this = that;
                                                                        t.url = 'no';
                                                                        n.sorry(t);
                                                                      }
                                                                    });
                                                              }
                                                            })
                                                            : app.globalData.pay({
                                                              data: {
                                                                submitok: 'party_bm',
                                                                openid: t.openid,
                                                                fid: that.fid
                                                              },
                                                              success: function () {
                                                                that.init();
                                                              },
                                                              fail: function (t) {
                                                                t.this = that;
                                                                t.url = 'no';
                                                                n.sorry(t);
                                                              }
                                                            })
                                                        : that.init();
                                                  }
                                                })
                                                : that.init();
                                          }
                                        })
                                        : ((a.this = that), (a.url = 'no'), n.sorry(a));
                                  }
                                });
                              }
                            }
                          })
                          : uni.showToast({
                            title: '请输入【生年】',
                            icon: 'none',
                            mask: true
                          })
                  : uni.showToast({
                    title: '请输入【微信】',
                    icon: 'none',
                    mask: true
                  })
              : uni.showToast({
                title: '请输入【手机】',
                icon: 'none',
                mask: true
              });
    },

    vipFn: function () {
      app.globalData.chklogin().then(function (t) {
        t
            ? uni.navigateTo({
              url: '/pagesA/my_vip/my_vip'
            })
            : uni.navigateTo({
              url: '/pages/login/login'
            });
      });
    },

    mask_closeFn: function (t) {
      var that = this;
      var i = t.currentTarget.dataset.maskid;
      this.setData({
        mask_class: 'alpha100_0'
      });
      setTimeout(function () {
        var t;
        that.setData((a((t = {}), i, false), a(t, 'mask_class', 'alpha0_100'), t));
      }, 500);
    },

    DJSFn: function (t) {
      var that = this;
      that.setInter = setInterval(function () {
        var n = 0;
        var i = 0;
        var o = 0;
        var e = 0;
        t > 0
            ? ((n = Math.floor(t / 86400)),
            (i = Math.floor((t / 3600) % 24)) <= 9 && (i = '0' + i),
            (o = Math.floor((t / 60) % 60)) <= 9 && (o = '0' + o),
            (e = Math.floor(t % 60)) <= 9 && (e = '0' + e),
                that.setData({
                  djs_D: n,
                  djs_H: i,
                  djs_M: o,
                  djs_S: e
                }),
                t--)
            : (clearInterval(that.setInter), that.init());
      }, 1000);
    },

    mapFn: function () {
      uni.openLocation({
        latitude: Number(this.D.latitude),
        longitude: Number(this.D.longitude),
        scale: 14,
        name: this.D.address,
        address: this.D.address
      });
    },

    b_t: function (t, a) {
      if (null == t || '' == t || null == a || '' == a) {
        return [t, a];
      }
      var n = 3.141592653589793;
      var i = parseFloat(t) - 0.0065;
      var o = parseFloat(a) - 0.006;
      var e = Math.sqrt(i * i + o * o) - 0.00002 * Math.sin(o * n);
      var s = Math.atan2(o, i) - 0.000003 * Math.cos(i * n);
      return [(t = (e * Math.cos(s)).toFixed(7)), (a = (e * Math.sin(s)).toFixed(7))];
    },

    topbarFn: function (a) {
      var that = this;
      var o = 2 == a ? 2 : parseInt(a.currentTarget.dataset.idx);
      this.setData({
        currentTab: o
      });
      if (1 == o) var e = 'sign_ulist';
      else if (2 == o) {
        e = 'bbs_list';
      }
      o ||
      (uni.showLoading({
        title: '玩命加载中...',
        mask: true
      }),
          app.globalData.ajax({
            url: 'party.php',
            data: {
              submitok: e,
              openid: t.openid,
              fid: that.fid
            },
            success: function (t) {
              1 == t.flag
                  ? 1 == o
                      ? that.setData({
                        signnum: t.signnum,
                        signulist: t.ulist
                      })
                      : 2 == o &&
                      that.setData({
                        bbsnum: t.bbsnum,
                        bbslist: t.list
                      })
                  : uni.showToast({
                    title: t.msg,
                    icon: 'none',
                    mask: true
                  });
              uni.hideLoading();
            }
          }));
    },

    bbs_btnFn: function () {
      var that = this;
      app.globalData.chklogin().then(function (a) {
        a
            ? that.setData({
              div_bbs: true
            })
            : uni.navigateTo({
              url: '/pages/login/login'
            });
      });
    },

    getPhoneNumber: function (t) {
      app.globalData.getPhoneNumber({
        e: t,
        url: '/pagesA/party/party_detail?fid=' + this.fid
      });
    },

    getmobFn: function (n) {
      var that = this;
      uni.login({
        success: function (e) {
          uni.request({
            url: app.globalData.WWW + '/api/wxxcx/get_openid.php',
            data: {
              code: e.code
            },
            success: function (e) {
              e = app.globalData.jsoneval(e.data);
              t = uni.getStorageSync('COOK_U');
              uni.request({
                url: app.globalData.WWW + '/api/wxxcx/get_mob.php',
                data: {
                  session_key: encodeURIComponent(e.U.session_key),
                  encryptedData: encodeURIComponent(n.detail.encryptedData),
                  iv: encodeURIComponent(n.detail.iv),
                  openid: e.U.openid,
                  submitok: 'getmob'
                },
                success: function (t) {
                  t = app.globalData.jsoneval(t.data);
                  that.setData(a({}, 'U.cook_mob', t.mob));
                },
                fail: function (t) {
                  uni.showModal({
                    content: t,
                    showCancel: false
                  });
                }
              });
            }
          });
        }
      });
    },

    back: function () {
      this.setData({
        div_login: false
      });
    },

    div_bbs_closeFn: function () {
      this.setData({
        div_bbs: false,
        div_bm_add: false
      });
    },

    div_bbs_submitFn: function (a) {
      var that = this;
      var e = a.detail.value;
      app.globalData.empty(e.content)
          ? uni.showToast({
            title: '请输入评论内容',
            icon: 'none',
            mask: true
          })
          : uni.showModal({
            title: '',
            content: '确定提交么？\r\n以下情形话题将被删除或封号：\r\n《请勿留下任何形式联系方法》\r\n《请勿发表涉黄涉政言论》\r\n《不得辱骂或攻击他人》',
            confirmColor: that.color,
            cancelText: '取消',
            confirmText: '确定',
            success: function (a) {
              if (a.confirm) {
                uni.showLoading({
                  title: '正在保存',
                  mask: true
                });
                app.globalData.ajax({
                  url: 'party.php',
                  data: {
                    submitok: 'bbs_add',
                    openid: t.openid,
                    fid: that.fid,
                    content: e.content
                  },
                  success: function (t) {
                    uni.hideLoading();
                    1 == t.flag
                        ? uni.showModal({
                          content: t.msg,
                          confirmColor: that.color,
                          confirmText: '朕知道了',
                          showCancel: false,
                          success: function (t) {
                            that.setData({
                              div_bbs: false
                            });
                            that.topbarFn(2);
                          }
                        })
                        : ((t.this = that), (t.url = 'no'), n.sorry(t));
                  }
                });
              }
            }
          });
    },

    backtopFn: function (t) {
      uni.pageScrollTo({
        scrollTop: 0,
        duration: 300
      });
    },

    zxFn: function () {
      uni.pageScrollTo({
        scrollTop: 999999,
        duration: 300
      });
    },

    telFn: function (t) {
      uni.makePhoneCall({
        phoneNumber: this.D.kf_tel
      });
    },

    mobFn: function (t) {
      uni.makePhoneCall({
        phoneNumber: this.D.kf_mob
      });
    },

    ifagreeFn: function (t) {
      1 == t.detail.value
          ? this.setData({
            ifagree: true
          })
          : this.setData({
            ifagree: false
          });
    },

    ifagree_passFn: function () {
      uni.showToast({
        title: '请先点击同意《用户协议》和《隐私条款》',
        icon: 'none',
        mask: true,
        duration: 3000
      });
    },

    emptyFn() {
      console.log('占位：函数 emptyFn 未声明');
    },

    certFn() {
      console.log('占位：函数 certFn 未声明');
    },

    dataFn() {
      console.log('占位：函数 dataFn 未声明');
    },

    gpsFn() {
      console.log('占位：函数 gpsFn 未声明');
    }
  }
};
</script>
<style>
@import 'party_detail.css';
</style>
